/* eslint-disable */
import request from '../../utils/request';

/** 流式对话 POST /chat/completion */
export async function chat(
  body: API.AiChatReqVO,
  options?: { [key: string]: any }
) {
  return request<API.AIResponse[]>("/chat/completion", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除对话 POST /chat/delete */
export async function deleteChat(
  body: API.DeleteChatReqVO,
  options?: { [key: string]: any }
) {
  return request<API.ResponseObject>("/chat/delete", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询历史对话 POST /chat/list */
export async function findChatHistoryPageList(
  body: API.FindChatHistoryPageListReqVO,
  options?: { [key: string]: any }
) {
  return request<API.PageResponseFindChatHistoryPageListRspVO>("/chat/list", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询对话历史消息 POST /chat/message/list */
export async function findChatMessagePageList(
  body: API.FindChatHistoryMessagePageListReqVO,
  options?: { [key: string]: any }
) {
  return request<API.PageResponseFindChatHistoryMessagePageListRspVO>(
    "/chat/message/list",
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** 新建对话 POST /chat/new */
export async function newChat(
  body: API.NewChatReqVO,
  options?: { [key: string]: any }
) {
  return request<API.ResponseObject>("/chat/new", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 重命名对话摘要 POST /chat/summary/rename */
export async function renameChatSummary(
  body: API.RenameChatReqVO,
  options?: { [key: string]: any }
) {
  return request<API.ResponseObject>("/chat/summary/rename", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}
